Object.defineProperty(exports, "__esModule", {
  value: true
});
var _def_ObjectUtils = function () {
  function _creator() {}
  _creator.deepCopy = function (t) {
    var o = new WeakMap();
    var n = function (e) {
      if (null === e) {
        return null;
      }
      var t = e.constructor;
      switch (t) {
        case Array:
          return function (e) {
            var t = [];
            o.set(e, t);
            e.forEach(function (e) {
              t.push(r(e));
            });
            return t;
          }(e);
        case Map:
          return function (e) {
            var t = new Map();
            o.set(e, t);
            e.forEach(function (e, o) {
              t.set(o, r(e));
            });
            return t;
          }(e);
        case Set:
          return function (e) {
            var t = new Set();
            o.set(e, t);
            e.forEach(function (e) {
              t.add(r(e));
            });
            return t;
          }(e);
        case Date:
        case Number:
        case String:
          return a(t, e);
        case Boolean:
          return a(t, e.valueOf());
        case RegExp:
          return function (e) {
            var t = new RegExp(e.source, e.flags);
            t.lastIndex = e.lastIndex;
            return t;
          }(e);
      }
      var n = Object.create(Reflect.getPrototypeOf(e));
      o.set(e, n);
      var c = 0;
      for (var s = Reflect.ownKeys(e); c < s.length; c++) {
        var u = s[c];
        var l = Reflect.getOwnPropertyDescriptor(e, u);
        var d = __assign({}, l);
        "value" in l && (d.value = r(e[u]));
        Reflect.defineProperty(n, u, d);
      }
      return n;
    };
    var a = function (e, t) {
      return new e(t);
    };
    var r = function (t) {
      if ("object" != typeof t) {
        return t;
      } else if (o.has(t)) {
        return o.get(t);
      } else {
        return n(t);
      }
    };
    return r(t);
  };
  _creator.mapToObject = function (e) {
    var t = {};
    var o = Array.from(e.keys());
    for (var n = 0; n < o.length; n++) {
      var i = o[n];
      t[i] = e.get(i);
    }
    return t;
  };
  _creator.objectToMap = function (e) {
    var t = new Map();
    if (!e) {
      return t;
    }
    var o = Object.keys(e);
    for (var n = 0; n < o.length; n++) {
      var i = o[n];
      t.set(i, e[i]);
    }
    return t;
  };
  _creator.diff = function (e, t) {
    var o = {};
    var n = Object.keys(e);
    for (var i = 0; i < n.length; i++) {
      var a = n[i];
      e[a] !== t[a] && (o[a] = t[a]);
    }
    return o;
  };
  return _creator;
}();
exports.default = _def_ObjectUtils;